<?php
// +----------------------------------------------------------------------
// | 海豚PHP框架 [ DolphinPHP ]
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 河源市卓锐科技有限公司 [ http://www.zrthink.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://dolphinphp.com
// +----------------------------------------------------------------------
// | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------

    namespace app\cms\admin;

    use app\admin\controller\Admin;
    use think\Db;

    /**
     * 仪表盘控制器
     * @package app\cms\admin
     */
    class Index extends Admin
    {
        /**
         * 首页
         * @author 蔡伟明 <314013107@qq.com>
         * @return mixed
         */
        public function index()
        {
            $this->assign('document', Db::name('cms_document')->where(['app_id' => env('app_id')])->where('trash', 0)->count());
            $this->assign('column', Db::name('cms_column')->where(['app_id' => env('app_id')])->count());
            $this->assign('page', Db::name('cms_page')->where(['app_id' => env('app_id')])->count());
            $this->assign('model', Db::name('cms_model')->where(['app_id' => env('app_id')])->count());
            $this->assign('page_title', '仪表盘');
            return $this->fetch(); // 渲染模板
        }
    }